﻿<%@ Page Language="C#" EnableEventValidation="false" MasterPageFile="~/Design/MasterPage/MasterPage.master"  AutoEventWireup="true" CodeFile="AccountForm.aspx.cs" Inherits="App_Input_AccountForm"  Title="结账单"%>

<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
<script type="text/javascript" >
function popPrint(type)
{
var date=window.document.getElementById('<%=hidDate.ClientID%>').value;
var id=window.document.getElementById('<%=hidReceivableId.ClientID%>').value;
var ids=window.document.getElementById('<%=hidReceivableIds.ClientID%>').value;
if("ONE" == type)
{
window.open('./AccountPrintForm.aspx?PRINT_TYPE='+type+'&DATE='+date+'&ID='+id,'AccountPrintForm','toolbars=0,resizable=1');
}
else
{
window.open('./AccountPrintForm.aspx?PRINT_TYPE='+type+'&DATE='+date+'&ID='+ids,'AccountPrintForm','toolbars=0,resizable=1');
}

}


 function buildChange(object)
    {
     CommonAjaxUtils.FindFloor(object.value,get_floor_Result_CallBack);
     CommonAjaxUtils.FindRoom(object.value,"",get_room_Result_CallBack);

    }
    
    function floorChange(object)
    {
         var objBuildNo= window.document.getElementById('<%=dropBuildNo.ClientID %>')
         CommonAjaxUtils.FindRoom(objBuildNo.value,object.value,get_room_Result_CallBack);
    }
    function get_floor_Result_CallBack(response)
            {
                if (response.value != null)
                {                    
 
                    var drop = window.document.getElementById('<%=dropFloor.ClientID %>');
                    drop.length=0;　　　　            
　　　　            var ds = response.value;
                    if(ds != null && typeof(ds) == "object")
                    {                   
　　　　　　                drop.options.add(new Option("",""));
                        for(var i=0; i<ds.length; i++)
　　　　                {
　　　　       
　　　　　　                var name=ds[i].Floor;
　　　　　　                var id=ds[i].Floor;
　　　　　　                drop.options.add(new Option(name,id));
　　　　                }                
                    }
                }
                return
            }
            
            function get_room_Result_CallBack(response)
            {
                if (response.value != null)
                {                    
 
                    var drop = window.document.getElementById('<%=dropRoomNo.ClientID %>');
                    drop.length=0;　　　　            
　　　　            var ds = response.value;
                    if(ds != null && typeof(ds) == "object")
                    {                   
　　　　　　                drop.options.add(new Option("",""));
                        for(var i=0; i<ds.length; i++)
　　　　                {
　　　　       
　　　　　　                var name=ds[i].ApartmentNo;
　　　　　　                var id=ds[i].ApartmentNo;
　　　　　　                drop.options.add(new Option(name,id));
　　　　                }                
                    }
                }
                return
            }
</script>
    <table width="100%">
        <tr>
            <td>
                <table border="0" class="table_border_line">
                    <tr>
                        <td align="left">

                            <script language="javascript" type="text/javascript">
                (new TitleBar('MemberBar', ' 检索条件')).showBar();
                            </script>

                        </td>
                    </tr>
                </table>
            </td>
        </tr>
         <tr>
            <td>
                <table border="0" class="table_border_line">
                    <tr>
                        <td style="width: 15%; height: 35px">
                        </td>
                        <td style="width: 10%; height: 35px">
                            会员编号
                        </td>
                        <td style="width: 30%; height: 35px">
                        <asp:TextBox ID="txtMemberNo" runat="server" MaxLength="12" Width="85px"></asp:TextBox>
                            <asp:TextBox ID="txtMemberName" runat="server" Width="89px" BackColor="#E0E0E0" BorderColor="#E0E0E0"
                                ForeColor="Black" contentEditable="false"></asp:TextBox>
                            <a href="#" onclick="javascript:popupMemberSearch('<%=txtMemberNo.ClientID%>', '<%=txtMemberName.ClientID %>' );">
                                <img id="searchImg" runat="server" src="../../images/search.jpg" border="0" />
                            </a>
                        </td>
                        <td style="width: 10%; height: 35px">
                            楼号
                        </td>
                        <td style="height: 35px">
                        <asp:DropDownList ID="dropBuildNo" runat="server" DataTextField="BuildingNo"
                                        DataValueField="BuildingNo" CausesValidation="True" Width="76px" onchange="buildChange(this)">
                                    </asp:DropDownList>
                        </td>
                    </tr>
                    <tr>
                        <td style="width: 15%; height: 35px">
                        </td>
                        <td style="width: 10%; height: 35px">
                            卡号</td>
                        <td style="width: 30%; height: 35px">
                            <asp:TextBox ID="txtPosId" runat="server"></asp:TextBox></td>
                        <td style="width: 10%; height: 35px">
                            楼层</td>
                        <td style="height: 35px">
                            <asp:DropDownList ID="dropFloor" runat="server" DataTextField="Floor" DataValueField="Floor"
                                        Width="76px" onchange="floorChange(this)">
                            </asp:DropDownList></td>
                    </tr>
                    <tr>
                        <td style="width: 15%; height: 35px">
                        </td>
                        <td style="width: 10%; height: 35px">
                            会员姓名</td>
                        <td style="width: 30%; height: 35px">
                            <asp:TextBox ID="txtName" runat="server"></asp:TextBox></td>
                        <td style="width: 10%; height: 35px">
                            房间号</td>
                        <td style="height: 35px">
                            <asp:DropDownList ID="dropRoomNo" runat="server" DataTextField="ApartmentNo" DataValueField="ApartmentNo"
                                        Width="76px" onchange="">
                            </asp:DropDownList></td>
                    </tr>
                   
                    <tr>
                        <td style="width: 15%; height: 35px;">
                        </td>
                        <td style="width: 10%; height: 35px;">
                            付款标志</td>
                        <td style="width: 30%; height: 35px;">
                            <asp:RadioButtonList ID="radPayFlg" runat="server" RepeatDirection="Horizontal">
                                <asp:ListItem Selected="True" Value="0">未缴费</asp:ListItem>
                                <asp:ListItem Value="1">已缴费</asp:ListItem>
                                <asp:ListItem Value="2">全部</asp:ListItem>
                            </asp:RadioButtonList></td>
                        <td style="width: 10%; height: 35px;">
                        </td>
                        <td style="height: 35px">
                        </td>
                    </tr>
                    <tr>
                        <td style="width: 15%; height: 35px">
                        </td>
                        <td style="width: 10%; height: 35px">
                            账单月份</td>
                        <td style="width: 30%; height: 35px"><asp:DropDownList ID="dropYear" runat="server" DataTextField="Floor" DataValueField="Floor"
                                        Width="76px" onchange="">
                        </asp:DropDownList>
                            &nbsp; 年&nbsp;
                            <asp:DropDownList ID="dropMonth" runat="server" DataTextField="Floor" DataValueField="Floor"
                                        Width="49px" onchange="">
                        </asp:DropDownList>
                            &nbsp; 月</td>
                        <td style="width: 10%; height: 35px">
                        </td>
                        <td style="height: 35px">
                        </td>
                    </tr>
                    <tr>
                        <td style="width: 15%; height: 35px">
                        </td>
                        <td align="center" colspan="3" style="height: 35px">
                            <asp:Button ID="btnSrh" runat="server" CssClass="button" Text="检 索" Width="82px" OnClick="btnSrh_Click" /></td>
                        <td style="height: 35px">
                        </td>
                    </tr>
                </table>
            </td>
        </tr>
        <tr>
            <td>
                <table border="0" class="table_border_line">
                    <tr>
                        <td align="left">

                            <script language="javascript" type="text/javascript">
                (new TitleBar('MemberBar', ' 检索结果')).showBar();
                            </script>

                        </td>
                    </tr>
                </table>
            </td>
        </tr>
        <tr>
            <td style="height: 135px" valign="top">
               <asp:GridView ID="GridView1" runat="server" CssClass="GridView_table" AutoGenerateColumns="False"
                    OnSelectedIndexChanged="GridView1_SelectedIndexChanged" DataKeyNames="ReceivableId" OnPageIndexChanging="GridView1_PageIndexChanging"
                    Width="100%" BorderWidth="0px" AllowPaging="True">
                    <Columns>
                        <asp:BoundField HeaderText="住址" DataField="Address">
                            <ItemStyle CssClass="GridView_item_center" Width="25%" />
                            <HeaderStyle CssClass="GridView_head_grayblue" />
                        </asp:BoundField>
                        <asp:BoundField HeaderText="主会员编号" DataField="MainMemberNo">
                            <ItemStyle CssClass="GridView_item_center" Width="15%" />
                            <HeaderStyle CssClass="GridView_head_grayblue" />
                        </asp:BoundField>
                        <asp:BoundField HeaderText="主会员姓名" DataField="MainMemberName">
                            <ItemStyle CssClass="GridView_item_center" Width="15%" />
                            <HeaderStyle CssClass="GridView_head_grayblue" />
                        </asp:BoundField>
                        <asp:BoundField HeaderText="副会员编号" DataField="SecondaryMemberNo">
                            <ItemStyle CssClass="GridView_item_center" Width="15%" />
                            <HeaderStyle CssClass="GridView_head_grayblue" />
                        </asp:BoundField>
                        <asp:BoundField HeaderText="副会员姓名" DataField="SecondaryMemberName">
                            <ItemStyle CssClass="GridView_item_center" Width="15%" />
                            <HeaderStyle CssClass="GridView_head_grayblue" />
                        </asp:BoundField>
                        <asp:BoundField HeaderText="应缴金额(元)" DataField="Sum" DataFormatString="{0:N}" HtmlEncode="False">
                            <ItemStyle CssClass="GridView_item_center" Width="10%" />
                            <HeaderStyle CssClass="GridView_head_grayblue" />
                        </asp:BoundField>
                        <asp:CommandField ButtonType="Image" HeaderText="明细" SelectImageUrl="~/images/edit.jpg"
                                SelectText="" ShowSelectButton="True">
                                <ItemStyle CssClass="GridView_item_center" />
                                <HeaderStyle  CssClass="GridView_head_grayblue" Width="10%" />
                            </asp:CommandField>     
                            
                        
                    </Columns>
                    <PagerStyle HorizontalAlign="Right" VerticalAlign="Middle" />
                </asp:GridView>
            </td>
        </tr>
        <tr>
            <td align="center" style="height: 33px" valign="bottom">
                <input id="btnPrint1" type="button" class="button" value="打印全部账单"  runat="server"  onclick="popPrint('TOTAL')" style="width: 92px" visible="false"/></td>
        </tr>
        <tr>
            <td style="height: 30px">
                <table border="0" class="table_border_line">
                    <tr>
                        <td align="left">

                            <script language="javascript" type="text/javascript">
                (new TitleBar('MemberBar', ' 账单明细')).showBar();
                            </script>

                        </td>
                    </tr>
                </table>
            </td>
        </tr>
        <tr>
            <td>
                <table border="0" class="table_border_line">
                    <tr>
                        <td style="width: 54px; height: 30px">
                        </td>
                        <td style="height: 30px; width: 230px;">
                        房间号：
                            <asp:Label ID="labApartmentNo" runat="server"></asp:Label></td>
                        <td style="height: 30px; width: 252px;">
                        </td>
                        <td style="height: 30px">
                        </td>
                        <td style="height: 30px">
                        </td>
                    </tr>
                    <tr>
                        <td style="width: 54px; height: 30px">
                        </td>
                        <td style="height: 30px; width: 230px;">
                            应缴金额：<asp:Label ID="labCount" runat="server" Text="0.00" Font-Bold="True" ForeColor="Red"></asp:Label>
                            /元</td>
                        <td style="height: 30px; width: 252px;">
                            消费状态：<asp:Label ID="labStatus" runat="server"></asp:Label></td>
                        <td style="height: 30px">
                        </td>
                        <td style="height: 30px">
                        </td>
                    </tr>
                    <tr>
                        <td style="width: 54px; height: 30px">
                        </td>
                        <td style="height: 30px; width: 230px;">
                            主会员编号：<asp:Label ID="labMainMemberNo" runat="server"></asp:Label></td>
                        <td style="height: 30px; width: 252px;">
                            主会员姓名：<asp:Label ID="labMainMemberName" runat="server"></asp:Label></td>
                        <td style="height: 30px">
                            主会员卡号：<asp:Label ID="labMainPosId" runat="server"></asp:Label></td>
                        <td style="height: 30px">
                        </td>
                    </tr>
                    <tr>
                        <td style="width: 54px; height: 30px">
                        </td>
                        <td style="height: 30px; width: 230px;">
                            副会员编号：<asp:Label ID="labSecondMemberNo" runat="server"></asp:Label></td>
                        <td style="height: 30px; width: 252px;">
                            副会员姓名：<asp:Label ID="labSecondMemberName" runat="server"></asp:Label></td>
                        <td style="height: 30px">
                            副会员卡号：<asp:Label ID="labSecondPosId" runat="server"></asp:Label></td>
                        <td style="height: 30px">
                        </td>
                    </tr>
                    <tr>
                        <td style="width: 54px; height: 23px">
                        </td>
                        <td style="height: 23px; width: 230px;">
                        </td>
                        <td style="height: 23px; width: 252px;">
                        </td>
                        <td style="height: 23px">
                        </td>
                        <td style="height: 23px">
                        </td>
                    </tr>
                </table>
                <asp:GridView ID="GridView2" runat="server" CssClass="GridView_table" AutoGenerateColumns="False"
                      OnPageIndexChanging="GridView2_PageIndexChanging"
                    Width="100%" BorderWidth="0px" AllowPaging="True">
                    <Columns>
                        <asp:BoundField HeaderText="消费日期" DataField="NewDate" DataFormatString="{0:yyyy/MM/dd}" HtmlEncode = "False">
                            <ItemStyle CssClass="GridView_item_center" Width="10%" />
                            <HeaderStyle CssClass="GridView_head_grayblue" />
                        </asp:BoundField>
                        <asp:BoundField HeaderText="会员编号" DataField="MemberNo">
                            <ItemStyle CssClass="GridView_item_center" Width="15%" />
                            <HeaderStyle CssClass="GridView_head_grayblue" />
                        </asp:BoundField>
                        <asp:BoundField HeaderText="会员姓名" DataField="MemberName">
                            <ItemStyle CssClass="GridView_item_left" Width="20%" />
                            <HeaderStyle CssClass="GridView_head_grayblue" />
                        </asp:BoundField>
                        <asp:BoundField HeaderText="消费内容" DataField="receivableName">
                            <ItemStyle CssClass="GridView_item_left" Width="35%" />
                            <HeaderStyle CssClass="GridView_head_grayblue" />
                        </asp:BoundField>
                        <asp:BoundField HeaderText="金额" DataField="receivableAmount" DataFormatString="{0:N}" HtmlEncode="False">
                            <ItemStyle CssClass="GridView_item_left" Width="20%" />
                            <HeaderStyle CssClass="GridView_head_grayblue" />
                        </asp:BoundField>
                      

                       
                    </Columns>
                    <PagerStyle HorizontalAlign="Right" VerticalAlign="Middle" />
                </asp:GridView>
            </td>
        </tr>
        <tr>
            <td align="center" style="height: 33px" valign="bottom">
            <input id="btnPrint" type="button" class="button" value="打印当前账单"  runat="server"  onclick="popPrint('ONE')" style="width: 90px" visible="false"/>
               </td>
        </tr>
    </table>
    <asp:HiddenField ID="hidDate" runat="server" />
    <asp:HiddenField ID="hidReceivableId" runat="server" />
    <asp:HiddenField ID="hidReceivableIds" runat="server" />
</asp:Content>
